<!--
 * @Description: CFA-simulation_jk 机考题库 --simulation_jk
 * @Author: your name
 * @Date: 2024-01-20
 * @LastEditTime: 2024-01-20
 * @LastEditors: Please set LastEditors
-->

<template>
  <div>
    <!-- 选择题目 -->
    <div class="testlist" v-if="testList_show">
      <div class="inner">
        <div class="top">
          <strong>选择要做的题目</strong>
        </div>
        <div class="list">
          <div class="list_main">
            <div
              class="item"
              @click="chooseTest(item, index)"
              v-for="(item, index) in 14"
              :key="index"
            >
              <p>【May 2023丨Mar.】衍生、另类、组合、道德</p>
              <p>
                <!--  -->
                <img
                  src="@/assets/images/sure_color.png"
                  alt=""
                  v-if="testIdx == index"
                />
                <span
                  class="reportsBt"
                  v-if="!item.status == 1"
                  @click="test_sure(item.ai_id, 1, 2)"
                >
                  开始测试
                </span>
                <span
                  class="reportsBt"
                  v-if="item.status == 2"
                  @click="test_sure(item.ai_id, 1, 2)"
                >
                  重新测试
                </span>
                <span
                  class="reportsBt"
                  v-if="item.status == 3"
                  @click="lookreport(item.report_id, 2)"
                >
                  查看报告
                </span>
              </p>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'simulation_jk',
  data() {
    return {
      testList_show: true,
      testIdx: -1 // 要做题目的列表
    }
  },
  created() {},
  mounted() {
    console.log(this.$route.name)
    if (this.$route.name == 'simulation_jk') {
      this.addOne()
    }
  },
  methods: {
    addOne() {
      this.$store.commit('hideGlobalComponent', false)
    },
    // 开始测试/重新测试
    test_sure() {},
    lookreport() {},
    chooseTest(item, idx) {
      this.testIdx = idx
    }
  }
}
</script>

<style scoped lang="scss">
.testlist {
  width: 100%;
  height: 100%;
  background: #ced8dd;
  position: fixed;
  top: 0;
  left: 0;
  .inner {
    width: 970px;
    height: 670px;
    background: red;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 5px;
    background: #ffffff;
    box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
    .top {
      width: 100%;
      height: 50px;
      background: #4d4c4d;
      border-radius: 5px 5px 0 0;
      text-align: center;
      strong {
        font-size: 16px;
        color: #fff;
        line-height: 50px;
      }
    }
    .list {
      position: relative;
      width: 100%;
      height: calc(100% - 50px);
      border-radius: 0 0 5px 5px;
      overflow: hidden;

      //   // 滚动条样式
      //   &::-webkit-scrollbar {
      //     width: 10px;
      //   }
      //   // 滚动槽
      //   &::-webkit-scrollbar-track {
      //     border-radius: 10px;
      //     background: #f2f2f2;
      //     // box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
      //   }
      //   // 滚动滑块
      //   &::-webkit-scrollbar-thumb {
      //     border-radius: 10px;
      //     background: #b4bbc5;
      //     // box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
      //   }

      .list_main {
        height: 500px;
        overflow-y: auto;
        .item {
          width: 80%;
          height: 40px;
          border: 3px solid #3d505a;
          box-sizing: border-box;
          background: #ffffff;
          margin: 20px auto;
          display: flex;
          align-items: center;
          text-indent: 1em;
          justify-content: space-between;
          img {
            width: 28px;
            height: 28px;
            margin-right: 20px;
            vertical-align: middle;
          }
          .reportsBt {
            display: inline-block;
            font-size: 14px;
            background: #f5f5f5;
            border: 1px solid #ddd;
            color: #333;
            line-height: 12px;
            padding: 9px 20px;
            // margin-top: 14px;
            border-radius: 4px;
            cursor: pointer;
          }
        }
        .item:hover {
          border-color: #f1d176;
        }
      }
      .btns {
        width: 225px;
        height: 40px;
        display: flex;
        justify-content: space-between;
        position: absolute;
        left: 50%;
        bottom: 30px;
        transform: translateX(-50%);
        button {
          width: 97px;
          height: 100%;
          text-align: center;
          line-height: 40px;
          font-size: 17px;
          color: #ffffff;
          border: 0;
          outline: none;
          background: #8cc63f;
          border-radius: 4px;
        }
        button:last-child {
          background: #409eff;
        }
      }
    }
  }
}
</style>
